Repository navigation
fix(setups): add the flattened klarna, paypal, tabby and stc pay fields - #277
Conversation
Payment Setup returns each payment method's next action directly on the method. The Go types dropped it on unmarshal, so the Klarna client token and the PayPal order ID could not be read. Adds the action and the request fields the spec defines for Klarna, PayPal, Tabby and stc pay.
🟢 Risk Classification: LOWApproval route: AI Auto-Approval Classification reasons
Operational gates
Files analysed: 2 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
The spec defines a different action object for each payment method, so each one gets its own type with a typed action type, as Cash App, Pay by Bank and Instrument already do. Also deprecates the payment_method_options the API no longer sends on the touched methods, as requested in review.
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 3 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
🟢 Advisory review: Looks good to meThis PR still needs a human approval — wall-e cannot auto-approve it. For what it's worth, I read the diff and found nothing I'd block on. Adds flattened action, IBAN, brand_name, shipping_preference, and payment_types fields to Klarna, PayPal, Tabby, and stc pay payment method structs, with matching tests covering wire keys, enum values, deserialization, and round-trips. The changes are additive and non-breaking, and the tests verify the claims in the description. What I checked
This is not an approval. wall-e cannot auto-approve this PR — it is an opinion to help whoever does. Advisory review · us.anthropic.claude-sonnet-4-6 · wall-e 2026.06.19-02 |
|



Summary
Payment Setup returns the next action of each payment method directly on the method (
payment_methods.klarna.action,payment_methods.paypal.action,payment_methods.stcpay.action). The Go types did not model it, soGetPaymentSetupdropped it and a merchant could not read the Klarna client token or the PayPal order ID needed to launch those flows. This adds the action and the other fields the spec defines for Klarna, PayPal, Tabby and stc pay. The spec defines a different action object per method, so each method gets its own action type, as Cash App, Pay by Bank and Instrument already do.Changes
payments/setups/setups.go:KlarnaPaymentMethod: read-onlyAction(*KlarnaAction) andIban.PaypalPaymentMethod:BrandName(max 127 characters),ShippingPreferenceand read-onlyAction(*PaypalAction).StcpayPaymentMethod: read-onlyAction(*StcpayAction);Otpdocumented as write only.TabbyPaymentMethod:PaymentTypes([]string).KlarnaAction(Type,ClientToken,SessionId),PaypalAction(Type,OrderId) andStcpayAction(Type), withKlarnaActionType(sdk),PaypalActionType(sdk) andStcpayActionType(otp).PaypalShippingPreferencewithPaypalShippingPreferenceNoShipping,PaypalShippingPreferenceGetFromFileandPaypalShippingPreferenceSetProvidedAddress.PaymentMethodOptionson Klarna, PayPal, stc pay and Tabby marked deprecated (see below).payments/setups/setups_fields_test.go: literal wire keys for the PayPal and Tabby request fields (read-onlyactionandpayment_method_optionsnot sent), everyPaypalShippingPreferenceand action type value, deserialization ofactionfrom Klarna, PayPal and stc pay plus Klarnaibanfrom a response with the spec examples, and a roundtrip of every new property.test/payment_setups_test.go: comment updated to the flattened shape.API Reference
POST /payments/setups:payment_methods.paypal.brand_name,payment_methods.paypal.shipping_preference,payment_methods.tabby.payment_typesPUT /payments/setups/{id}GET /payments/setups/{id}POST /payments/setups/{id}/confirm/{payment_method_name}Deprecated
PaymentMethodOptionsonKlarnaPaymentMethod,PaypalPaymentMethod,StcpayPaymentMethodandTabbyPaymentMethod. The API removedpayment_method_options: it no longer sends it and ignores it on requests. UseActioninstead (Tabby has no replacement). It will be removed in the next major version. Requested in review.Breaking changes
None. Only new fields and types, and deprecation notices.
PaypalPaymentMethod.UserActionstays astring.README
No change needed.